
<div style="margin-top: 20px"><?php echo __('search_job',  null, 'company_jobs')?></div>			

<div class="box-content-main">
	<table class="table-list" cellspacing="0" cellpadding="0" border="1" style="border-collapse: collapse;">
		<tr>
			<td class="head title"><?php echo __('head_title',null,'company_jobs')?></td>
			<td class="head company"><?php echo __('head_company',null,'company_jobs')?></td>
			<td class="head major"><?php echo __('head_major',null,'company_jobs')?></td>
			<td class="head salary"><?php echo __('head_salary',null,'company_jobs')?></td>
			<td class="head area"><?php echo __('head_work_area',null,'company_jobs')?></td>
			<td class="head action"><?php echo __('head_action',null,'company_jobs')?></td>
		</tr>
		
	<?php
	foreach ( $data ['jobs'] as $val ) :
		?>
		<tr>
			<td class="title">
				<a href="#"	class="job-detail" data-apply="<?php echo __('apply', null, 'company_jobs')?>" data-title="<?php echo html_entity_decode($val['title'])?>" data-id="<?php echo $val['id']?>">	<?php echo $val['title']?></a>
			</td>
			<td class="company">
				<?php
					$com = CompaniesTable::getDataById ( $val ['company_id'] );
					echo empty ( $com ['company_name'] ) ? 'N/A' : $com ['company_name']?>
			</td>
			<td class="major">
				<?php
					$majors = MasterMajorsTable::getDataListByJobId ( $val ['id'] );
					$str = '';
					foreach ( $majors as $m ) :
						echo $str, $m ['name'];
						$str = ', ';
					endforeach
					;
				?>
			</td>
			<td class="salary">
				<?php echo intval($val['salary_payed'])>0?(sfConfig::get('app_currency_symbol').$val['salary_payed']):((intval($val['salary_from'])<=0 && intval($val['salary_to'])<=0)?__('label_salary_discuss',null,'company_jobs'):(sfConfig::get('app_currency_symbol').$val['salary_from'].' - '.sfConfig::get('app_currency_symbol').$val['salary_to']))?>
			</td>
			<td class="area">
				<?php
					$areas = LocationCitiesTable::getDataListByJobId ( $val ['id'] );
					$str = '';
					foreach ( $areas as $m ) :
						echo $str, $m ['name'];
						$str = ', ';
					endforeach;
				?>
			</td>
			<td class="action">
				<?php
					$jPass = CandidatesTable::getListCandidatePassById($data['id']);
					$jWaitLong = CandidatesTable::getListCandidateWaitLongById($data['id']);
					if(empty($jPass) && empty($jWaitLong)) {
				?>
					<a href="#" class="apply-insert" data-title="<?php echo __('apply_title', null, 'company_jobs')?>" data-candidate-id="<?php echo $data['id']?>" data-job-id="<?php echo $val['id']?>" ><?php echo __('apply', null, 'company_jobs')?></a>
				<?php
					}
				?>
			</td>
		</tr>
		<?php endforeach;?>
		<?php if(count($data['jobs']) ==0):?>
		<tr>
			<td colspan="6">
				<div class="note"><?php echo __('no_row_founded',null,'table_list')?></div>
			</td>
		</tr>
		<?php endif;?>
	</table>
</div>